using System;
using Rainbow.ObjectFlow.Framework;
using Rainbow.ObjectFlow.Interfaces;
using Rainbow.ObjectFlow.Language;

namespace Rainbow.Demo.Objectflow.Client
{
    public class CoffeeCustomerService : AsAWorkflow<CustomerState>
    {
        public override IWorkflow<CustomerState> Configure()
        {
            return Workflow<CustomerState>.Definition()
                .Configure()
                .On<Exception>(() => Console.WriteLine("Caught an exception"))
                .When<CustomerState>()
                .Do<PlaceOrder>()
                .Do<PayForCoffee>()
                .Do<PickUp>();
        }
    }
}